package com.tuanzi.loan.business.service.product.prefilter.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tuanzi.loan.business.entity.product.prefilter.LoanProductPrefilter;
import com.tuanzi.loan.business.repository.product.prefilter.LoanProductPrefilterRepository;
import com.tuanzi.loan.business.service.product.prefilter.LoanProductPrefilterService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.repository.JPAAuditRepository;
import com.tuanzi.loan.core.service.BaseAuditServiceImpl;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.product.prefilter.LoanProductPrefilterSearchRequest;
import com.tuanzi.loan.vo.response.product.prefilter.LoanProductPrefilterSearchResponse;

import lombok.extern.slf4j.Slf4j;

/**
 * @author Ray 2017/09/21
 */
@Slf4j
@Debug
@Service
@Transactional
public class LoanProductPrefilterServiceImpl extends BaseAuditServiceImpl<LoanProductPrefilter, Long> implements LoanProductPrefilterService {

	@Autowired
	private LoanProductPrefilterRepository productPrefilterRepository;

	@Override
	public Page<LoanProductPrefilterSearchResponse> list(PageSearcher<LoanProductPrefilterSearchRequest> pageSearcher) {
		return productPrefilterRepository.list(pageSearcher.getSearchCondition(), pageSearcher.getPageable());
	}

	@Override
	protected JPAAuditRepository<LoanProductPrefilter, Long> getRepository() {
		return productPrefilterRepository;
	}

}
